'''
九九乘法表
'''
# 第一种
for row in range(1, 10):
    for col in range(1, row + 1):
        print('{}x{}={:<2}'.format(col, row, row * col), end=' ')
    print('')

print('==' * 40)
# 第二种
for row in range(9, 0, -1):
    for col in range(1, row + 1):
        print('{}x{}={:<2}'.format(col, row, row * col), end=' ')
    print('')

print('==' * 40)
# 第三种
for row in range(1,10):
    for col in range(9,0,-1):
        if row < col:
            print(" " * 8,end="")
        else:
            print("{}x{}={:>2}".format(row, col, row * col), end="  ")
    print()

print('==' * 40)
# 第四种
for row in range(9,0,-1):
    for col in range(9,0,-1):
        if row < col:
            print(" " * 8, end="")
        else:
            print("{}x{}={:>2}".format(row, col, row * col), end="  ")
    print()

print('==' * 40)

# 第五种
row = 1
while row <= 9:
    col = 1
    while col <= row:
        print("{}x{}={:>2}".format(col, row, row * col), end="  ")
        col += 1
    print()
    row += 1

print('==' * 40)

# 第六种
row = 9
while row >= 1:
    col = 1
    while col <= row:
        print("{}x{}={:>2}".format(col, row, row * col), end="  ")
        col += 1
    print()
    row -= 1

print('==' * 40)

# 第七种
row = 1
while row <= 9:
    col = 9
    while col >= 1:
        if row < col:
            print(" " * 8,end="")
        else:
            print("{}x{}={:>2}".format(col, row, row * col), end="  ")
        col -= 1
    print()
    row += 1

print('==' * 40)

# 第八种
row = 9
while row >= 1:
    col = 9
    while col >= 1:
        if row < col:
            print(" " * 8,end="")
        else:
            print("{}x{}={:>2}".format(col, row, row * col), end="  ")
        col -= 1
    print()
    row -= 1

